<?php 
/*
Plugin Name: Xujoe的插件(父级自动勾选，菜单排序分级，批量删除分类的整合)
Plugin URI: http://www.xujoe.com/xujoe
Description: 父级自动勾选，菜单排序分级，批量删除分类的整合
Author: xujoe
Version: 2.1
Author URI:  http://www.xujoe.com
*/
 

error_reporting(E_ERROR | E_WARNING | E_PARSE);
    //  define( 'CSS', plugin_dir_url( __FILE__ ) . 'css/' );//定义css根目录

   define( 'JS', plugin_dir_url( __FILE__ ) . 'js/' );//定义js根目录
 $php_self=substr($_SERVER['PHP_SELF'],strrpos($_SERVER['PHP_SELF'],'/')+1);   //获取当前页面文件名
function loadjs(){      
        wp_enqueue_script( 'xujoe_js' ,JS.'xujoe.js');//js 
		//wp_enqueue_script( 'xujoe_js1' ,JS.'moveinfo.js');//js    		
} 

if('post-new.php'==$php_self ||'post.php'==$php_self){//父级自动勾选
add_action('admin_enqueue_scripts','loadjs');	
}

function load_nav_menus(){      
        wp_enqueue_script( 'xujoe_js' ,JS.'nav_menus.js');//js    
}
if('nav-menus.php'==$php_self ){//菜单排序分级
add_action('admin_enqueue_scripts','load_nav_menus');	
}



function load_del_cat(){      
        wp_enqueue_script( 'xujoe_js' ,JS.'delCat.js');//js    
}
if('edit.php'==$php_self ){//批量删除分类
add_action('admin_enqueue_scripts','load_del_cat');	
}  




function xujoe_download(){  //下载的管理页面    
        wp_enqueue_script( 'xujoe_download_js' ,JS.'download.js');//js    
}
if('post.php'==$php_self){//下载的管理页面  
//print_r($php_self);  
add_action('admin_enqueue_scripts','xujoe_download');	
}  




if('index-admin.php'==$php_self ||$_REQUEST['page']=='xujoe001' ){
require_once('uploadPro/uploadPro.php');//导入批量上传的插件
}  














